package com.wuba.rxjavademo.tzx.filter;

import com.wuba.rxjavademo.tzx.common.Base;

/**
 * Created by tanzhenxing
 * Date: 2016/6/27.
 * Description:
 * distinctUntilChanged() 过滤连续相同的值，当下一个值与上一个值不同时发射
 * eg:0,0,1,2,3->0,1,2,3
 */
public class RxDistinctUntilsChanged extends Base {
    public static void main(String [] args) {
        RxDistinctUntilsChanged distinctUntilsChanged = new RxDistinctUntilsChanged();
        distinctUntilsChanged.run();
    }

    @Override
    public void run() {
        getObservable()
                .distinctUntilChanged()
                .subscribe(Base::print);
    }
}
